package com.cloudeasy.provider.service;

import com.cloudeasy.provider.model.dto.gaode.GaodeLocation;
import com.cloudeasy.provider.service.hystrix.OpcGaodeFeignApiHystrix;
import com.cloudeasy.security.feign.OAuth2FeignAutoConfiguration;
import com.cloudeasy.wrapper.Wrapper;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Create By 郭金宝 on 2019/1/14.<br>
 */
@FeignClient(value = "cloudeasy-provider-opc", configuration = OAuth2FeignAutoConfiguration.class, fallback = OpcGaodeFeignApiHystrix.class)
public interface OpcGaodeFeignApi {

    /**
     * IP定位.
     *
     * @param ipAddr the ip addr
     *
     * @return the location by ip addr
     */
    @PostMapping(value = "/api/auth/getLocationByIpAddr")
    Wrapper<GaodeLocation> getLocationByIpAddr(@RequestParam("ipAddr") String ipAddr);
}
